package com.elbis.access.wg.api.request;

import com.elbis.access.request.RequestEntity;

public class WOTRequestEntity extends RequestEntity {

	private static final long serialVersionUID = 2071205526252760939L;

	protected String application_id = null;

	public WOTRequestEntity(String applicationId) {
		application_id = applicationId;
	}

	/**
	 * @return the application_id
	 */
	public String getApplication_id() {
		return application_id;
	}

	/**
	 * @param application_id
	 *            the application_id to set
	 */
	public void setApplication_id(String application_id) {
		this.application_id = application_id;
	}

	@Override
	public String toString() {
		return toHttpRequestParameters();
	}

	/**
	 * Builds a string out of all the parameters set for this request and
	 * returns the http request like representation of these parameters.
	 * 
	 * @return parameters in the form as follows:
	 *         <code>?paramName1=paramValue1&paramName2=paramValue2</code>
	 */
	public String toHttpRequestParameters() {
		StringBuilder builder = new StringBuilder();
		builder.append("?");
		if (application_id != null) {
			builder.append("application_id=");
			builder.append(application_id);
		}
		return builder.toString();
	}
}
